home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / dateimanager / mtool / source / miconinfo.c < prev    next >
C/C++ Source or Header  |  1996-04-07  |  2KB  |  54 lines

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*  MIconInfo    -   Ruft unter OS3.0 WBInfo() auf      Version 1.0r001   */
  4. /*                                                                        */
  5. /*  ©1994 Boris Jakubaschk    Entwicklungszeit: 28.05.1994 - 28.05.1994   */
  6. /*                                                                        */
  7. /*  Idee und erste Version in E programmiert von Lionel Vintenat          */
  8. /*                                                                        */
  9. /**************************************************************************/
  10.  
  11. #include <exec/types.h>
  12. #include <exec/libraries.h>
  13. #include <intuition/intuition.h>
  14. #include <clib/exec_protos.h>
  15. #include <clib/intuition_protos.h>
  16. #include <clib/dos_protos.h>
  17. #include <dos/dos.h>
  18. #include <workbench/workbench.h>
  19. #include <string.h>
  20.  
  21. main( int argc, char *argv[])
  22.    {
  23.    struct Library *WbBase;
  24.    struct Screen  *Scr;
  25.    char Path[130];
  26.    char FileName[30];
  27.    char *a;
  28.    BPTR FL;
  29.  
  30.    if (WbBase = OpenLibrary( "workbench.library", 39 ))
  31.        {
  32.        if (argc>1)
  33.            {
  34.            a = FilePart( argv[1] );
  35.            strcpy( Path, argv[1] );
  36.            Path[a-argv[1]]='\0';
  37.            strcpy( FileName, a );
  38.            if ((strlen(FileName)>5)
  39.             && (stricmp( FileName+strlen(FileName)-5, ".info" )==0))
  40.                FileName[strlen(FileName)-5] = '\0';
  41.            if (FL = Lock( Path, ACCESS_READ ))
  42.                {
  43.                if (Scr = LockPubScreen( 0 ))
  44.                    {
  45.                    WBInfo( FL, FileName, Scr );
  46.                    UnlockPubScreen( NULL, Scr );
  47.                    };
  48.                UnLock( FL );
  49.                };
  50.            };
  51.        CloseLibrary( WbBase );
  52.        };
  53.    }
  54.